package com.itheima.sh.client;

import com.itheima.sh.client.fallback.UserFeignApiFallBack;
import com.itheima.sh.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Primary;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "user-service",
        fallback = UserFeignApiFallBack.class)
//feign  客户端 远程调用user-service服务
@Primary
public interface UserFeignApi {

    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") String username);
}
